package com.example.applicationjet.livedata;

import androidx.annotation.MainThread;
import androidx.lifecycle.LiveData;

/**
 * 单例的livedata，用户共享数据
 */
public class SignLiveData extends LiveData {

    private static SignLiveData sInstance; //单实例

    //获取单例
    @MainThread
    public static SignLiveData get() {
        if (sInstance == null) {
            sInstance = new SignLiveData();
        }
        return sInstance;
    }

    public static void add() {
        sInstance.setValue(1);
    }


}
